<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <body>
    欢迎${!empty sessionScope.username?username:'游客'}光临
    <a href="${pageContext.request.contextPath}/welcome.jsp">
    	首页
    </a>
    <div style="position:absolute;left:920px">
	    <a href="${pageContext.request.contextPath}/VoteServlet?method=exit">
	    	退出
	    </a>
    </div>
    <hr/>
    <table border="1" align="center" width="50%">
		<caption>投票人情况</caption>
		<tr>
			<th>IP</th>
			<th>时间</th>
			<th>归属地</th>
		</tr>
		<c:forEach var="info" items="${infoList}">
			<tr>	
				<td>
					${info.ip}
				</td>
				<td>
					<fmt:formatDate
						value="${info.votetime}"
						type="both"
						dateStyle="full"
						timeStyle="default"
					/>
				</td>
				<td>
					${!empty info.address.location?info.address.location:'未知'}
				</td>
			</tr>
		</c:forEach>
		<tr>
			<td>
			
			</td>
			<td>
				<a href="${pageContext.request.contextPath}/VoteServlet?method=findAllInfo">
					查询投票人情况
				</a>
			</td>
			<td>
				<a href="${pageContext.request.contextPath}/VoteServlet?method=toLoginJsp">
					投票人登录
				</a>
			</td>
		</tr>
    </table>	
  </body>
</html>
